package servlet;

import model.classes;
import model.student;
import model.users;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@WebServlet(value = "/a_seeStuInfo")
public class a_seeStuInfo extends HttpServlet{
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        HashMap<users, classes> hashMap = student.allStudentInfo();
        if (!hashMap.isEmpty()) {
            req.setAttribute("allStuInfo",hashMap);
            req.getRequestDispatcher("/jsp/a_seeStuInfo.jsp").forward(req,resp);
        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
